<?php
/**
 * Created by PhpStorm.
 * User: lee
 * Date: 2018/11/16
 * Time: 3:26 PM
 */


ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';


use Biz\service\Event;
use Biz\module\Decoupling\refund\AgreeRefund as deAgreeRefund;
use Biz\module\Decoupling\refund\ApplyRefund as deApplyRefund;

Event::consume([Event::ORDER_REFUND_MGT_AGREE_SUCCESS,Event::ORDER_REFUND_USER_APPLY_SUCCESS], function ($message,$eventTag,$queueName) {

    switch ($eventTag){
        case Event::ORDER_REFUND_MGT_AGREE_SUCCESS:
            new deAgreeRefund($message,$queueName);
            break;
        case Event::ORDER_REFUND_USER_APPLY_SUCCESS:
            new deApplyRefund($message,$queueName);
            break;
    }

},'php.biz.cli.ctrl_refund');